package models.Models;

import models.SystemModels.SystemUserVIP;
import models.SystemModels.SystemUserVIPType;

public class VIPInitialization {
    /**
     * @参数传入几个对象，分别为价钱，类别，标题
     * @param moneys
     * @param type
     * @param title
     * @return
     */
    public static Boolean VIPCreate(double moneys,String type,String title){
       try {
           SystemUserVIPType system = new SystemUserVIPType();
           system.VIPMoneys = moneys+"";
           system.VIPName = type;
           system.VIPTitle = title;
           system.VIPType =type;
           system.save();
           return true;
       }catch (Exception ex){
           return false;
       }
    }

    /**
     * @用户VIP
     * @param userId
     * @param VIP
     * @return
     */
    public static Boolean SystemUserVIPs(int userId,int VIP){
        try{
            SystemUserVIP  systemUserVIP = new SystemUserVIP();
            systemUserVIP.SystemUserId=userId;
            systemUserVIP.SystemUserVIPTypeId= VIP;
            systemUserVIP.save();
            return false;
        }catch (Exception ex){
            return true;
        }
    }
}
